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
App: Allow interpolation string as the only value on input-code
interface
#22318
App: Allow interpolation string as the only value on input-code
interface
#22318
Conversation
🦋 Changeset detectedLatest commit: 915abeb The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is only applicable in context of Flows, we should add an option to the interface that allows us to control this behavior.
@joselcvarela Had another idea: How about auto switching to raw editor if a plain interpolation string is detected? Then we wouldn't have to touch the |
This is useful when want to pass the previous payload of an operation to the next operation within Flows
5a6071d
to
b561a89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as intended 🚀
(On my previous idea: Would be a bigger changeover as the code interface currently only emits when value is valid... Not worth it at the moment.)
Scope
When using Flows, there's cases that we just want to pass the response from previous operation to the next one.
For example, we might want to pass the payload of a Read Date operation to another flow using Trigger Flow operation.
For such cases we should be able to pass the following into the Payload option of Trigger Flow operation:
Although, the Code interface will complain because the Payload option is defined as JSON and this value is not a valid JSON so the linter will show an error.
Since this is a valid action to do (to pass
{{ $last }}
), in this PR we ignore the lint if the value is an interpolation, i.e., if the value starts with{{
and ends with}}
.What's changed:
Potential Risks / Drawbacks
{{
and ends with}}
, there will be no errorsReview Notes / Questions
For example, we could try add some validation into
OperationsService
but the App send the operation data within a flow which will be handled byFlowService
so no validation would be madeComparision
Screen.Recording.2024-04-25.at.19.07.03.mov
Screen.Recording.2024-04-25.at.19.06.03.mov
{{$last}}
the Code interface shows an error. Although the Flow works as expected. When I type"{{ $last }}"
the Flow throws an error.{{$last}}
does not show any error any more and Flow works as expected. Although when typing"{{ $last }}"
it will still throw an error as"
are not removed and Flow will have double quotes conflicting.Fixes #21263