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

Canvas App - Dropdown with multiple actions

I am having canvas app.

Pointer 1.Scan Button Onscan : Set(varScan, BarcodeScanner1.Value)

Pointer 2. Textinput  Default: varScan

Pointer 3.DropDown Items : Filter(MaterialMasters,'MIKE'=TextInput4.Text ||  mm=TextInput4.Text)

 

AVTS_0-1619980536717.png

 

Requirement 1 :

Pointer 2 & Pointer 3 Should change upon Point 1 Click .(Note : Pointer 2 displayes the Pointer 1 scanned value(MIKE) and Pointer 3 displays the material number )

 

Current Status : Pointer 3 changes only if you enter manually in Pointer 2 also Pointer 2 only changed if Pointer 1 clicked.

 

Requirement 2 :

 

Pointer 3 should display all materialno from the table.

 

------------------------------------------------------------------------------------------------------------------

AVTS_1-1619981147393.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @AVTS ,

 

For your first requirement:

 

Do you want to use the MIKE column or mm column as the filter criteria? 

 

In other words, do you want the data to be automatically filtered according to the MIKE column after the user presses the button?

At the same time, do you want the data to be filtered according to the mm column if the user does not press the button and manually enter the value?

 

Is the problem you are facing now that the data in the drop-down list will not change after you press the button?

If the data type of your MIKE column is number, please try this formula:

Filter(MaterialMasters,'MIKE'=Value(TextInput4.Text) ||  mm=Value(TextInput4.Text))

 

For your second requirement:

Do you want the drop-down list to display all the values when textinput4 is blank?

If so ,please try this formula on Items property of your dropdown control:

If(IsBlank(TextInput4.Text),MaterialMasters,Filter(MaterialMasters,'MIKE'=Value(TextInput4.Text)||mm=Value(TextInput4.Text)))

 

And set the dropdown control's value property like picture:

v-xiaochen-msft_0-1620007414804.png

 

In addition, If you don’t want users to enter values into the textinput control, you could set its displaymode property to 'view'.

v-xiaochen-msft_1-1620007508321.png

 

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

14 REPLIES 14
v-xiaochen-msft
Community Support
Community Support

Hi @AVTS ,

 

For your first requirement:

 

Do you want to use the MIKE column or mm column as the filter criteria? 

 

In other words, do you want the data to be automatically filtered according to the MIKE column after the user presses the button?

At the same time, do you want the data to be filtered according to the mm column if the user does not press the button and manually enter the value?

 

Is the problem you are facing now that the data in the drop-down list will not change after you press the button?

If the data type of your MIKE column is number, please try this formula:

Filter(MaterialMasters,'MIKE'=Value(TextInput4.Text) ||  mm=Value(TextInput4.Text))

 

For your second requirement:

Do you want the drop-down list to display all the values when textinput4 is blank?

If so ,please try this formula on Items property of your dropdown control:

If(IsBlank(TextInput4.Text),MaterialMasters,Filter(MaterialMasters,'MIKE'=Value(TextInput4.Text)||mm=Value(TextInput4.Text)))

 

And set the dropdown control's value property like picture:

v-xiaochen-msft_0-1620007414804.png

 

In addition, If you don’t want users to enter values into the textinput control, you could set its displaymode property to 'view'.

v-xiaochen-msft_1-1620007508321.png

 

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

Hi partially achieved however i also need to filter the material number in dropdown when scan button(full cases) pressed .I mean requirement 1 also need to achieved along with requirement 2 .

v-xiaochen-msft
Community Support
Community Support

Hi @AVTS ,

 

I do not quite understand what you mean.

For example:

If requirement1 has 1 record and requirement2 has  4 records,do you want to show 5 records in dropdown?

 

Does the data for Requirement 1 and Requirement 2 come from different data sources?

If they come from one data source, then the data will be duplicated.

 

Best Regards,
Wearsky

All from one data source.

 

AVTS_0-1620022305254.png

 

AVTS_1-1620022342118.png

 

Pointer 2 has to functions . Function 1 : Dropdown(Pointer3) will show the material number based on the manual updation in the Inputtext4(Pointer2) . Function 2 : Inputtext4(Pointer2) change based on Barcode scan value(Pointer1) .

 

And drop-down(Pointer3) list to display all the values when textinput4(Pointer2) is blank .

 

 

v-xiaochen-msft
Community Support
Community Support

Hi @AVTS ,

 

I think the current formula can meet your above needs. Please give an example to describe your problem.

 

Best Regards,

Wearsky

If inputtext is blank then all material no is appearing in the dropdown whereas if you enter any records in inputtext then its not wrking . Getting following error.

 

 

AVTS_0-1620025069610.png

 

v-xiaochen-msft
Community Support
Community Support

Hi @AVTS ,

 

This may be caused by data type mismatch.

What's the data type of 'MIKE' and 'mm'?

v-xiaochen-msft_0-1620025607629.png

 

I suggest you change the data type to'General', and try to remove the Value() function in the formula, and finally refresh the data source.

 

Now the error disappeared after removing value from the formula.

 

Below Example : Barcode Scan click is displaying the results in Inputstext  but there is no response on the Dropdown which suppose to show the material number

 

AVTS_0-1620026482725.png

 

Below Example :  Material number appearing in the dropdown box if manually inputed the data in to inputtext

AVTS_1-1620026704591.png

 

v-xiaochen-msft
Community Support
Community Support

Hi @AVTS ,

 

Please try to do this :
Add a Timer control and set its OnTimeEnd property to:

ClearCollect(Col,Filter(MaterialMasters,'MIKE'=TextInput4.Text||mm=TextInput4.Text))

 

Set other fields like pictrue:

v-xiaochen-msft_0-1620028128896.png

 

Then use this formula:

If(IsBlank(TextInput4.Text),MaterialMasters,Col)

 

Best Regards,

Wearsky

 

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,668)