Repeat in Server Action - Output Fields not available from the Query

Wappler Version : 4.0.7
Operating System : MacOS
Server Model: ASP.NET
Database Type: MSSQL
Hosting Type: IIS

Expected behavior

Output Fields should be available for selection from the linked query

Actual behavior

Output Fields are not available for selection. Empty List message is shown.

How to reproduce

  1. Add a DB Query with output for 1 or more fields
  2. Add a Repeat step and select the above query
  3. No Fields are available under Output Fields in Repeat step from the query

I believe this bug was fixed in the latest update v4.0.7. I have Set Value step in the repeat that I have moved after the query as had been suggested as a workaround. Moving the Set Value steps worked in another SA but it’s not resolving the issue in this SA.

Screen Shot 2021-09-27 at 6.45.27 pm

Is there any workaround available for this issue? I can add a Repeat for the same query and add Output Fields outside the Condition, but as soon as I move it inside the Condition, the Output Fields are removed.

We are currently checking this issue, seems to happen when the repeat is nested inside a condition.

Thanks @Teodor.

Has this issue been fixed? I encounter this exact problem in the current version (4.1.3)

I just ran into this issue as well on 4.5.2 nodejs. Is there a workaround or is using a repeat within a condition not possible?

A workaround at this stage is to add the Output Fields manually by opening the Server Action in Code View. Find the code for Repeat record_repeat and add fields in the outputFields group.

"repeat": "{{record_repeat}}",
    "outputFields": [
        "Record1",
        "Record2"
    ],

The issue is only in the UI, the code works correctly.

1 Like

Thank you @guptast! I dragged the API and Repeat outside of the Condition and was able to use the UI to add the Output Fields and setup the fields in the repeat. I then moved the API and Repeat back into the Condition.

Glad it is working for you. This is a good workaround until this issue is resolved.

Is this still an issue with the latest Wappler because we can not reproduce it.

I just tested this and it works fine in a similar structure with a condition and repeat inside:

@kfawcett i see you are repeating the API Action step, are you sure you have the API Schema defined, otherwise the repeat doesn’t know what to output?

@Teodor @George

Just to check I see in the screenshot you tested query which Is outside the condition for me this also works as expected, for me the issue is where you have query_copy and query1 do these also work for you?

I also recreated lib to check if any files was outdated

Wappler 4.5.3

1 Like

The schema was defined and that’s why I could add the fields once I moved the API and repeat outside of the Condition. I tried to replicate the issue again, but was unsuccessful. I did make some changes to the Server Action though, so I’m not sure if the upgrade to v4.5.3 was the fix or if something I had in the previous Server Action setup was the cause. I’ll let you know if I experience it again.

This has been fixed in Wappler 4.6

This topic was automatically closed after 47 hours. New replies are no longer allowed.