cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ashtfg
Frequent Visitor

How to call a text input's onChange action manually

Hi Experts,

 

I have a gallery, from which i am doing a total on a text input. This works fine by itself. However i am to call the onChange action on this text input so that a set of instructions are called manually.  The functionality on the OnChange actually takes the amount in the text input and displays it in words in another label. This works perfectly if the text input it edited, however i would like to load the lines in the gallery and make the total read only and fire the onChange from maybe the form OnVisible so that the label with the words gets printed.

 

Is this possible or is there another work around ?

 

Thank you all in advance 🙂

 

Regards,

Ash

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@ashtfg The second part of the With has to evaluate to the text you want to see. Don't use Set, This will not work.

If(!IsBlank(Find(".",tbAmountTotal.Text)),Last(Split(tbAmountTotal.Text, ".")),"") 

View solution in original post

18 REPLIES 18
nickellis74
Resolver I
Resolver I

This is a bit of a cheeky reply because I'm not sure I can help but I am interested in how you've converted numbers to text.

CNT
Community Champion
Community Champion

@ashtfg Are you calculating this total in the TextBox manually or does it get calculated automatically based on the values in the Gallery?

ashtfg
Frequent Visitor

Automatically using sum of gallery column. 

CNT
Community Champion
Community Champion

@ashtfg Can you show me that code and also tell me where are you doing it and how you are setting the value to this Total Text Input.

ashtfg
Frequent Visitor

Also i tried to call the OnSelect Property of by using Select(tbAmountTotal) on the any changes but that also did not work, i dont know why.

ashtfg
Frequent Visitor

Any ideas @CNT  ?

CNT
Community Champion
Community Champion

@ashtfg The OnChange() property will fire only when a change is made and the user navigates away from the control, say clicks outside the TextInput.

Rather than doing this in the OnChange(), you can do this calculation in the same place where the other calculation is done and set it to a variable and then set the variable in the Text property of the Label.

ashtfg
Frequent Visitor

While i try this i realise that one of my posts was still pending moderation since i updated it. You asked me for the code and i have attached it here. Btw this is a newer version the labels are on visible hidden since they werent working correctly.

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (795)