cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Formula to increase version number by 1 when New Version Toggle is checked (binary- True)

Hi All,

I need help with the following scenario.

If somebody checks New Version, i want previous version number and latest version number.

Actually, i only need latest version number which can go from 1-10, based on how times- new version was selected while modifying a SharePoint list item on Power Apps form.

GauravG_0-1603373511574.png

Can you please suggest how to create this? I am barely getting started and tried If(DataCardValue40.Value = true,1,0), that is why it shows 0 in Previous Version Number field. Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

@GauravG 

Please consider changing your Formula on the Text property of your Previous Version Number textbox to the following:

If(DataCardValue40.Value, Parent.Default + 1, Parent.Default)

It is assumed that DataCardValue40 is your toggle control.  And that you have not changed the Default property of the datacard where your Previous Version Number field is located.

 

I hope this is helpful for you.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

Found the solution using Update If- check MS doc- here

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-update-updateif

 

I used this- UpdateIf(Business_Requirement_Document, Title = Title_DataCard3.Default, {'Latest Version Number':ThisItem.'Latest Version Number' + 1 })

 

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

@GauravG 

Please consider changing your Formula on the Text property of your Previous Version Number textbox to the following:

If(DataCardValue40.Value, Parent.Default + 1, Parent.Default)

It is assumed that DataCardValue40 is your toggle control.  And that you have not changed the Default property of the datacard where your Previous Version Number field is located.

 

I hope this is helpful for you.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

@RandyHayes Thanks

This will work to give me either 0 or 1, but if the previous version number is 6- then if a person selects toggle for new version, i would want the latest version to show as 7, previous version (don't need this field though if it's not needed to formulate latest version number) to show as 6.

The range of values i have set-up for previous version is 0-9, and latest version range is 1-10. Thanks

Highlighted

@GauravG 

Is your intention to update previous version and latest version when you submit the record?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

@RandyHayes Yes, basically- if somebody is opening this form for the first time- the values would be 0 (previous), 1 (latest).

If we receive a request a change teh report- we would then have a new version of the report, which would be 2 (latest), 1 (previous)....and so until 9 (previous) & 10 (current) as we can have 10 versions max.

Hope it helps, eagerly waiting!

 

Highlighted

Found the solution using Update If- check MS doc- here

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-update-updateif

 

I used this- UpdateIf(Business_Requirement_Document, Title = Title_DataCard3.Default, {'Latest Version Number':ThisItem.'Latest Version Number' + 1 })

 

View solution in original post

Highlighted

@GauravG 

Sorry to miss your reply from earlier.  The forums were acting very strange earlier and it didn't seem to come through.

I am glad you got to the results you needed.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,984)