Skip to content

Curl step: Expose fields from response to use in next steps. #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: MOODLE_405_STABLE
Choose a base branch
from

Conversation

sumaiyamannan
Copy link

@sumaiyamannan sumaiyamannan commented May 13, 2025

This change will expose fields from response to use in next steps.

Currently a curl step response needs to be read via a reader step and probably then it needs to be saved in a file or need other steps to parse the data into variables to be fed in other steps. With this patch, the data parsed and iterated from this single step itself.

Testing instructions

  • Create a curl step (connector or flow)
  • Add a value in 'Counter field'
  • Define variables using the counter field for e.g. access_token: '${{ record.access_token }}'
  • Use the above variable in another step for e.g. ${{steps.gettoken.record.access_token}}

See screenshots below for reference
Expose response variables
expose_response_variables png

Consume response variables
consume_response_variables

In addition, the use of debugging() function in place of moodle_exception will allow logging of curl response in case of failures.

Regards,
Sumaiya

@sumaiyamannan sumaiyamannan force-pushed the exposecurlvariables branch from e8b1a68 to d660d7f Compare May 13, 2025 23:08
@sumaiyamannan sumaiyamannan force-pushed the exposecurlvariables branch from d660d7f to ad19d2a Compare May 18, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant