cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jstark123
Level: Powered On

ClearCollect with a value from a Date Picker using SelectedDate

Hello all!

 

I'm currently working on a feature in a Canvas app that collects a number of inputs from an Edit Form so they can be used after the form is submitted using the ClearCollect command. One of the inputs is a Date Picker with the ID "DateValue1".

 

My ClearCollect formula looks like this:

If(
shortageTicket_ = true && shortageView_ = false,
ClearCollect(
ShortageTicketInfo,
{
WorkOrderNumber: workOrderNumber_value2.Text,
Index: index_value.Text,
RequiredBy: DateValue1.SelectedDate,
EmailList: DataCardValue12.Text,
OrderType: orderType_value2.Selected.Value,
PriorityLevel: DataCardValue5.Selected.Value,
Department: DataCardValue6.Selected.Value,
DeliverTo: DataCardValue22.Text,
ConfirmationNumber: DataCardValue20.Text
}
)
)

The formula collects all the values without the ".SelectedDate" property added to the end of the DateValue1, but collects a record instead of a string. As soon as I add the .SelectedDate property to DateValue1, I get an error saying "The function ClearCollect has some invalid arguments."

 

Does anyone have a fix? Am I missing something obvious?

 

Thank you in advance for help!

1 ACCEPTED SOLUTION

Accepted Solutions
KroonOfficeSol
Level 10

Re: ClearCollect with a value from a Date Picker using SelectedDate

Probably you need to reset your collection. Just put a 1 after the name and see if the error goes away. If that's the case your problem is with the schema of the collection.

Paul
4 REPLIES 4
KroonOfficeSol
Level 10

Re: ClearCollect with a value from a Date Picker using SelectedDate

Probably you need to reset your collection. Just put a 1 after the name and see if the error goes away. If that's the case your problem is with the schema of the collection.

Paul
Community Support Team
Community Support Team

Re: ClearCollect with a value from a Date Picker using SelectedDate

Hi @jstark123 ,

Please check whether the date picker's name is DateValue1?

Under normal circumstances,the control inside a form will be named DataCardValue....

Please use the date picker's name instead of the card's name.

Try this formula:

If(
shortageTicket_ = true && shortageView_ = false,
ClearCollect(
ShortageTicketInfo,
{
WorkOrderNumber: workOrderNumber_value2.Text,
Index: index_value.Text,
RequiredBy: DataCardValue1.SelectedDate,  ///assume that the date picker's name is DataCardValue1
EmailList: DataCardValue12.Text,
OrderType: orderType_value2.Selected.Value,
PriorityLevel: DataCardValue5.Selected.Value,
Department: DataCardValue6.Selected.Value,
DeliverTo: DataCardValue22.Text,
ConfirmationNumber: DataCardValue20.Text
}
)
)

What's more, you could also try to recreate another collection.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jstark123
Level: Powered On

Re: ClearCollect with a value from a Date Picker using SelectedDate

I'm sure it's named DateValue1. Here's a screenshot of the card in the tree view:

 

PAissue.PNG

jstark123
Level: Powered On

Re: ClearCollect with a value from a Date Picker using SelectedDate

Paul's solution worked perfectly! Thank you!

 

Are there any resources on the schema of collections, how they're set, and how to work with them?

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 196 members 5,778 guests
Please welcome our newest community members: