cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WebPortal
Post Prodigy
Post Prodigy

Allowed values from Excel table

My app has a dropdown table that lets users select a month in text form like: "Jan-2020", "Feb-2020", etc.

The app is connected to an Excel file in OneDrive.

The AllowedValues property is set to:

["Jan-2020";"Fev-2020";"Mar-2020";"Abr-2020";"Mai-2020";"Jun-2020";"Jul-2020";"Ago-2020";"Set-2020";"Out-2020";"Nov-2020";"Dez-2020"]

Now, I want to restrict this list to exclude the values already recorded in the Excel table (column "Periodo").

So, how to express this logic in the AllowedValues property using PowerApps formula? It should read the column from Excel and then deduct the existing months from the list above, but how? 

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User III
Super User III

I assume your excel table is named "ExcelTable"

 

OnVisible of the App create a collection:
ClearCollect(ExcelDateEnteredCol,ExcelTable)

 

Then on the Items of the Dropdown put:

Filter(ExcelTable,Not(Periodo in ExcelDateEnteredCol.Periodo )

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

24 REPLIES 24
mdevaney
Super User III
Super User III

@WebPortal 

I would use a REMOVEIF function to discard any previously entered options.

RemoveIf(["Jan-2020";"Fev-2020";"Mar-2020";"Abr-2020";"Mai-2020";"Jun-2020";"Jul-2020";"Ago-2020";"Set-2020";"Out-2020";"Nov-2020";"Dez-2020"], Value in your_excel_datasource.Periodo);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

eka24
Super User III
Super User III

I assume your excel table is named "ExcelTable"

 

OnVisible of the App create a collection:
ClearCollect(ExcelDateEnteredCol,ExcelTable)

 

Then on the Items of the Dropdown put:

Filter(ExcelTable,Not(Periodo in ExcelDateEnteredCol.Periodo )

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

OnVisible of the screen you mean?

@WebPortal 

My code goes in the Items property of your Dropdown/ComboBox.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

On the creen where the dropdown is located:

OnVisible.JPG

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

I created the collection "PeriodosExistentes" OnVisible of the Screen.

It worked fine with the formula:

ClearCollect(PeriodosExistentes; Custos.Periodo)

 Then in Items property of the dropdown:

Filter(Custos;Not(Periodo in PeriodosExistentes))

I get a sytax error.

@mdevaney 
RemoveIf returns a syntax error.

@WebPortal 
Please provide a screenshot showing the highlighted formula bar along with the error message.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Use:

 

Filter(Custos;Not(Periodo in PeriodosExistentes.Periodo ))

 

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (60,055)