cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Update Text Input Box on SharePoint Edit Mode if a dropdown value changes

Hi,

 

a). User launches a new form built from a SharePoint list

b). There is a dropdown choice box (choices are “Yes” & “No”) - user selects "Yes"

c). Because the user selected "Yes", custom text gets added to a text input box (if the user selected "No", the text input box will return blank

d). User closes the form

e). User opens the same record on SharePoint (the form is now in Edit Mode) and changes the dropdown field choice to "No"

f). The text previously entered in the text box should get cleared

 

This works fine in New Form Mode. However, if I edit the form and change the dropdown choice box to “No”, although the text box correctly changes to "blank" on the form, it does not clear the previous text on SharePoint. Strangely, if I close the form and edit the form again, and then click save, the field is correctly updated on SharePoint.

 

Below is the formula I have added to the Default property on the Text Input box field.

 

If(ENT_BUYSELL.Selected.Value="Yes","BSHub",Blank())

Below is the formula I have added to the Update property on the Datacard for the Text Input box.

 

If(ENT_BUYSELL.Selected.Value <>"Yes","",ADDROLE_BUYSELL.Text)

 

Could anyone advise?

 

On a separate note, I use the following formula to update a separate dropdown choice box with blank if the dropdown box mentioned above is not “Yes”. This works fine in edit form mode and SharePoint is correctly updated with the change. I just cannot recreate this functionality for the Text Input Box.

 

If(ENT_BUYSELL <> "Yes",{Value: "-",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}, CORP_LOCK.Selected)

 

1 ACCEPTED SOLUTION

Accepted Solutions

To have the text input saved correctly, I think all you need to do is replace Blank() with "". The Update value of the data card should be what was originally in the property when the data card was added to the form. 

 

I am assuming that the data card value control for the choice field was renamed to ENT_BUYSELL and the Text Input data card value control was renamed to ADDROLE_BUYSELL. If this is true then the formula's should look like this:

 

Default property of Text Input control:

If(ENT_BUYSELL.Selected.Value="Yes","BSHub", "")

 

Update property of the Data Card for Text Box:

ADDROLE_BUYSELL.Text



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @imranamikhan 

 

The update property should be set as DataCardValue1.Text. //Check the TextInput Box control name

 

Default property of the TextInput:

 

If(ENT_BUYSELL.Selected.Value="Yes","BSHub", "")

 

Thanks.

Thanks for the response but adjusting the formula to reference the DataCard rather than the DataField does not resolve the problem.

 

In the current formula, ADDROLE_BUYSELL.Text is the DataField.

 

If(ENT_BUYSELL.Selected.Value <>"Yes","",ADDROLE_BUYSELL.Text)

 

Replacing this with the DataCard name is invalid:

 

If(ENT_BUYSELL.Selected.Value <>"Yes","",Buy-Sell Hub Role_DataCard1.Text)

 

This is because there is not option of appending "Text" to the formula for the DataCard (Buy-Sell Hub Role_DataCard1.Text)

Hi everyone - if anyone else could help that would be appreciated.

Have you tried using just ADDROLE_BUYSELL.Text in the Update property? 

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Yes but unfortunately the value in the Text Input Box does not get correctly updated on SharePoint. 

 

The below formula works for resetting dropdown selection boxes to blank on SharePoint, I just cannot get recreate this functionality for a text input box or get the correct syntax.

If(ENT_BUYSELL <> "Yes",{Value: "",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}, CORP_LOCK.Selected)

 

 

 

To have the text input saved correctly, I think all you need to do is replace Blank() with "". The Update value of the data card should be what was originally in the property when the data card was added to the form. 

 

I am assuming that the data card value control for the choice field was renamed to ENT_BUYSELL and the Text Input data card value control was renamed to ADDROLE_BUYSELL. If this is true then the formula's should look like this:

 

Default property of Text Input control:

If(ENT_BUYSELL.Selected.Value="Yes","BSHub", "")

 

Update property of the Data Card for Text Box:

ADDROLE_BUYSELL.Text



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Replacing Blank() with "" resolved the issue. SharePoint is correctly updating. Thank you so much again for your help

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 (2,444)