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

How update textinput text

JACK_LAI_1117_0-1602482380488.png

 

After user click Dropbox-A & Dropbox-B then Textinput will show a number which reference  Dropbox-A & Dropbox-B text in sharepoint list then return a number .

 

In Dropbox-B "onclick"  ........ Set(assetno,Value(LookUp(Asset_Manager_Classfiy,Title='Dropdown-asset-catatory'.Selected.Result && 'Catagory-A'='Dropdown-asset-detail'.SelectedText.Value).Asset_max_no)+1);

 

In Textinput "default "...........assetno

 

In Dropbox-C will show other number from other sharepoint list , if user click Dropbox-C number , I want to update Textinput text .

 

After I google , I found in Dropbox-C "onclcik" ...........updatecontext({assetno:Dropbox-C.selectitems.value}) ,but I do this , when APP initial running  , after click Dropbox-A & Dropbox-B then Textinput will show nothing , after I click Dropbox-C then Textinput will show the number what I click !!!

 

So how do I coding in my powerapp to get my goal !!!!!

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @JACK_LAI_1117 :

Firstly,let me explain why you encounted this problem.

The key is that the variable ‘assetno’ defined by the set function and the variable ‘assetno’ defined by the updatecontext function have the same name, but they are not the same variable.

  • Use the Set function to set the value of a global variable.
  • Use the UpdateContext function to create a context variable.

You can navigate to'File-Variable' to verify it. You can find ‘assetno’ under the Global tab and you can also find ‘assetno’ with different values under the tab on the current screen.

1.JPG

Secondly,please try this solution:

1\Clear Dropbox-B's "onclick" property

2\Set  Dropbox-B's "OnChange" property to 

Set(assetno,Value(LookUp(Asset_Manager_Classfiy,Title='Dropdown-asset-catatory'.Selected.Result && 'Catagory-A'='Dropdown-asset-detail'.SelectedText.Value).Asset_max_no)+1);
Reset(YourTextInputbox);/*Because once the TextInputbox is manually modified, its Default property no longer works. This step is to prevent the user from manually modifying the TextInputbox to cause the defalutl property to no longer work*/

3\Clear Dropbox-C's "onclcik" property

4\Set Dropbox-C's "OnChange" property to

Set(assetno,Dropbox-C.selectitems.value)/*I assume Dropbox-C.selectitems.value's datatype is number */

Or

Set(assetno,Value(Dropbox-C.selectitems.value))/*I assume Dropbox-C.selectitems.value's datatype is Text*/

Best Regards,

Bof

 

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @JACK_LAI_1117 :

Firstly,let me explain why you encounted this problem.

The key is that the variable ‘assetno’ defined by the set function and the variable ‘assetno’ defined by the updatecontext function have the same name, but they are not the same variable.

  • Use the Set function to set the value of a global variable.
  • Use the UpdateContext function to create a context variable.

You can navigate to'File-Variable' to verify it. You can find ‘assetno’ under the Global tab and you can also find ‘assetno’ with different values under the tab on the current screen.

1.JPG

Secondly,please try this solution:

1\Clear Dropbox-B's "onclick" property

2\Set  Dropbox-B's "OnChange" property to 

Set(assetno,Value(LookUp(Asset_Manager_Classfiy,Title='Dropdown-asset-catatory'.Selected.Result && 'Catagory-A'='Dropdown-asset-detail'.SelectedText.Value).Asset_max_no)+1);
Reset(YourTextInputbox);/*Because once the TextInputbox is manually modified, its Default property no longer works. This step is to prevent the user from manually modifying the TextInputbox to cause the defalutl property to no longer work*/

3\Clear Dropbox-C's "onclcik" property

4\Set Dropbox-C's "OnChange" property to

Set(assetno,Dropbox-C.selectitems.value)/*I assume Dropbox-C.selectitems.value's datatype is number */

Or

Set(assetno,Value(Dropbox-C.selectitems.value))/*I assume Dropbox-C.selectitems.value's datatype is Text*/

Best Regards,

Bof

 

View solution in original post

@v-bofeng-msft 

 

Thank you for your reply ,  finally I realize the variable's different

 

follow your code then I can change the assetno in my mind !!!

 

 

😁😁😁😁😁😁

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 (1,330)