Hi Community,
Need help in using UpdateIf formula below on 2 conditions
UpdateIf(Business_Requirement_Document, Title = Title_DataCard3.Default, {'Latest Version Number':'Latest Version Number' + 1 }.Text)
1st condition is New Version toggle should be On
2nd condition is that form submission should be successful (OnSuccess)
The UpdateIf formula has to change a field in the source SP list after form's submission and if this report is a new version.
Solved! Go to Solution.
You've got quite a few issues on that formula.
One is that you are first resetting the form...so all of the values you are then trying to use will be empty.
Then, UpdateIf will not return a value you can use like that. UpdateIf will return the entire datasource as a table. Then you are using 'Latest Version Number' + 1 - that is not a numeric value, then you are trying to get the Text value from a record...which will not work.
My suggestion is that you actually do everything you are trying to do with the Submit...why make another call to the datasource?
This kind of goes back to your previous post that I missed earlier. Rather than doing the update like that, just have your Latest Version Number datacard in your form. You don't have to have it visible, you can hide it. Then in the Update property of the datacard, set it to the following:
If(yourToggleControlName.Value, Parent.Default + 1, Parent.Default)
This is a somewhat hypothetical formula as I am not 100% sure on your column types. But the concept here is to add one to the underlying numeric column based on the toggle.
The advantage of this is that this will all happen in the SubmitForm. You don't need to make another trip to the datasource in the OnSuccess.
I hope this is helpful for you.
You've got quite a few issues on that formula.
One is that you are first resetting the form...so all of the values you are then trying to use will be empty.
Then, UpdateIf will not return a value you can use like that. UpdateIf will return the entire datasource as a table. Then you are using 'Latest Version Number' + 1 - that is not a numeric value, then you are trying to get the Text value from a record...which will not work.
My suggestion is that you actually do everything you are trying to do with the Submit...why make another call to the datasource?
This kind of goes back to your previous post that I missed earlier. Rather than doing the update like that, just have your Latest Version Number datacard in your form. You don't have to have it visible, you can hide it. Then in the Update property of the datacard, set it to the following:
If(yourToggleControlName.Value, Parent.Default + 1, Parent.Default)
This is a somewhat hypothetical formula as I am not 100% sure on your column types. But the concept here is to add one to the underlying numeric column based on the toggle.
The advantage of this is that this will all happen in the SubmitForm. You don't need to make another trip to the datasource in the OnSuccess.
I hope this is helpful for you.
Thanks @RandyHayes , i think i would need more help!
Based on your suggestion, i tried- If(yourToggleControlName.Value, Parent.Default + 1, Parent.Default)
However, the .Value part is not coming up due to control property of Toggle
I have highlighted the control with red and in the formula bar you can see what comes up with letter 'V'
Thanks again!
You are referencing your DataCard...you need to reference (in this case) the control in your datacard. What is the name of the toggle control? That is what you need to reference there.
@RandyHayes Please ignore this question, it's working as expected. Was a temporary glitch i think. Thanks
.........................................IGNORE BELOW...................................................
This old formula stopped working.
I actually deleted this datacard- 'Latest Version Number' by mistake and so not trying to redo- what you had suggested in this post long back.
The issue is that it keeps on saying formula is incorrect and doesn't show "DEFAULT" property of parent available for selection. Is there another way or am i doing it wrong again?
If the New Report/ Version toggle is ON, the value saved for Latest Version number, which would be a hidden field' should increase by 1
That was an easy one for me 😂
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
214 | |
209 | |
85 | |
57 | |
36 |