Issue: Recieving "Invalid use of '.' " Collect button.Onselect
When I set my formula for the Collect button using OnSelect = Collect(Destinations, txt_CompanyName!Text) PowerApps reverts the " ! " back to Collect(Destinations, txt_CompanyName.Text) and I get error message (see Issue section).
Any help is greatly appreciated.
Solved! Go to Solution.
Input Controls:
Steps
Resolved:
1. Input controls required the ' [ ] ' (i.e. [@txt_CompanyName].
Hi @Anonymous,
I believe you have a syntax problem with the collect function. The syntax is Collect( DataSource, Item, ... ). The items are enclosed in curly braces and are in the syntax- ColumnName:ControlName.Text), so if the columns in your data source are companyname, contactname, title, contactnumber, emailaddress and the names of your TextInput controls are txt_CompanyName, txt_ContactName, txt_Title, txt_ContactNumber, and txt_Email, the button should be Collect(destinations,{companyname: txt_CompanyName.Text,Title: txt_Title.Text, contactnumber: txt_ContactNumber.Text,emailaddress: txt_Email.Text}). I Hope that helps.
@Drrickryp Many kudos for being so prompt to help a fellow community member, thanks so much!
Always a pleasure. It's becoming a hobby!
@Drrickryp - Thanks for your help here. I tried your recommendation as well, but I was still prompted with Errors = "Invalid use of '.' btn_Collect (Collect button). Initally from research I've done. I was referred to use " ! " after inputs (i.e. Collect(Destination, {CompanyName: txt_CompanyName!Text, ContactName: txt_ContactName!Text}) and that worked, but when I tried to add to the formula that's when the " ! " turned to " . " and I started getting those error messages.
This is a Offline Form BTW.
Hi @Anonymous,
Are txt_CompanyName and txt_ContactName text control? If so, the formula should use "." not "!".
See in Operators reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/operators
"!" is equivalent to the Not function.
Regards,
Mona
Hi @v-monli-msft As I mentioned earlier, when I used " . " I still recieved errors (See formula in earlier thread). " ! " can be used as backwards compatiability as refered to the document you referenced and in another example that I found online. When I used the " ! " it worked, but as I continued to build the formula for the button, something changed.
Input Controls:
Steps
Resolved:
1. Input controls required the ' [ ] ' (i.e. [@txt_CompanyName].
User | Count |
---|---|
174 | |
111 | |
86 | |
44 | |
42 |
User | Count |
---|---|
229 | |
117 | |
116 | |
74 | |
67 |