Hi,
I’m trying to determine if there is a trick to get certain field of a data type to render when the app is live and different text to render when the app is in version-test.
I know I could just add a conditional for the action if app version is test or app version is live but I don’t want to do it that way as that creates multiple actions and then when things get updated, I have to update both actions which means things will inevitably be forgotten and bugs may ensue.
To create an example, let’s say in my user data type I have two fields:
Then I would do a"search for users:first item’s live text but you can’t conditionally choose “s live text” vs “s test text” (unless I create two actions with a conditional)
I could do this like this:
User data type has one field:
- text (where this is a list of texts)
Where the text values are “aaaa | test” and “bbbb | live” and then use "extract with regex to find the matching text based on the app version but this is combersome and the general advice is to stay away from lists.
Just wanted to know if anyone had a more elegant solution.
Thanks
I’m not sure I understand your objection to using conditions here, nor why you’re talking about using actions to display texts (presumably you’re talking about workflow actions - so I’m not sure what that has to do with displaying text - maybe I’m missing something?…)…
In any case, there is another way to do this - and that’s to simply define a condition (I.e. a yes/no value) directly in the text box (not in the conditional tab), then use format as text to determine what do display in the text box, based on wether the condition is true or not.
I.e. in the text box just put ‘isn’t live version’ formatted as text. Then for yes, set the text to display the test field, and for no the live field.
Thanks for getting back to me.
Sorry, I realize now it was confusing. I should have been more clear.
Specifically what I’m doing is building out my stripe.js functionality and when I say “display text” what I actually mean is render a value in a stripe.js action. More specifically, in test mode, I need to transfer money to a test account number and in live mode, I need to transfer to a live account number.
The reason I’m pushing back against conditions is because I am trying to drastically improve the efficiency/speed/performance of my app and reducing the amount of workflows/actions is one of the first steps. Also, with my stripe.js workflows, there are subsequent steps that rely on the result of previous steps, so if I have two actions (one for live and one for test) then every subsequent action that relies on this step will also have to be doubled up.
Hopefully that makes more sense.
Ah, ok… I understand now…
In that case using isn't live version: formatted as text
as I mentioned above is the simplest way to do it (it’s ideal for distinguishing between ‘live’ and ‘dev’ data in workflows) I use that for a lot of my Stripe calls to keep workflow steps to a minimum and it works great.
Yes that’s the way to distinguish between live and dev
But I have a specific stripe account number that I want to pass to one of the stripe.js actions when app version is live and a different one when it is dev.
My question is, is there a clever trick that will fill the “Seller/Account ID” field with the appropriate value as determined by the app version?
This is the field I want to dynamically fill:
In other words, I have my own stripe account that I use to debug and test out functionality. When in dev mode, I want all api calls to be directed to my stripe account. If I direct all api calls to my customer’s account, then they will see all of my test calls in test mode (which obviously I don’t want). When in live mode, I want all calls to be directed to my customer’s account. So I could achieve this with two stripe.js actions, each with a conditional to run depending on the app version but, I don’t want this because it doubles up on not just this action but subsequent actions in that workflow which gets messy and slows things down.
Appreciate your help here.
My question is, is there a clever trick that will fill the “Seller/Account ID” field with the appropriate value as determined by the app version?
Yes, as I said…
In the Seller/Account ID field put isn't live version: formatted as text
Then for Yes (meaning for the test version) put your own Stripe account ID
For No (meaning for the live version) put your customer’s Stripe account ID.
2 Likes
OOOHHH. Whoops. I misunderstood. That’s what I’m looking for. I was thinking you were talking about a conditional.
Thanks so much!!!
1 Like