cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rajesh
Advocate II
Advocate II

Text Input onchange event not firing after data load

I am customizing a SharePoint form that has a few text inputs and dropdowns. In the OnChange event of Text inputs and dropdowns I'm updating a collection. The text inputs onchange event works fine when creating a new item. However  when I edit an item, I don't see the onchange event of text inputs firing and the collection is not updated. However the onchange of dropdpwns work fine for both new and edit. It appears the onchange event of the TextInput is firing before the data is loaded. This is how my onchange event on text input looks

If(IsBlank(DataCardValue.Text), UpdateIf(MyCollection, ID=1,{Blank:true}), UpdateIf(MyCollection,ID=1,{Blank:false}))

 

Is there a way to delay the trigger of onchange till the data is fully loaded?

 

Thanks

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Rajesh,

Could you please share a bit more about the Collection that you mentioned?

How do you want to update the Collection when the OnChange event of the TextInput control fires?

 

I have made a test on my side, and don't have the issue that you mentioned. The OnChange event of the TextInput control fires well. The screenshot as below:10.JPG

 

11.JPG

Set the OnStart property of the FormScreen1 to following:

Set(Counter,0)

Set the OnChange property of the TextInput control to following formula:

If(IsBlank(DataCardValue1.Text),Set(Counter,0),Set(Counter,Counter+1))

Set the Text property of the Label to following:

Counter

The Counter variable auto-increment 1 when the OnChange event of TextInput control fires.

 

I think there is something issue with the formula that you provided. When you create a new item and type text within the TextInput control (DataCardValue), the seocnd UpdateIf function within the If function would be executed, and set the Blank property to false. But when you edit an item, if the TextInput box is not blank, the seocnd UpdateIf function within the If function would always be executed, unless the TextInput box is blank.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your reply. If you read my question carefully, I have mentioned that OnChange works fine when creating a new item. However when I edit an existing item, I can see the text input control displaying the value saved earlier, however the onchange function does not fire. This happens only with text input and works fine for dropdown

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,239)