cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dcoxi21
Frequent Visitor

Collect Function Not Recognizing Specific Column of Table

Hey guys,

I'm building a PRA form to collect information regarding my company's projects. Thus far, I've put all the information into collections for better performance throughout the app. It's now come time to send it all to our database on SQL Server. I've written out my first collect statement and everything looks good except that the first column (ProjectID) is not being recognized. "Name isn't valid. Identifier isn't recognized." is the error I get. Here is my statement:

ForAll(ResourceCost,
Collect('[dbo].[ResourceCost]', ProjectID: projid,
RoleID: LookUp('[dbo].[LINEITEM]', RoleID),
DailyCost: LookUp('[dbo].[LINEITEM]', DailyCost),
ResourceProfessionalFees: LookUp('[dbo].[LINEITEM]', ProFees),
ResourceID: LookUp('[dbo].[LINEITEM]', ResourceID),
ProfitSharing: LookUp('[dbo].[LINEITEM]', ProfitShared),
LeadBonus: LookUp('[dbo].[LINEITEM]', LeadBonus),
CreatedOn: Now(),
CreatedBy: "POWERAPPS_PRA",
LastModifiedOn: Now(),
LastModifiedBy: "POWERAPPS_PRA")));

 

I've set projid to a variable that holds the ID of the selected project. All columns are recognized except for the 'ProjectID' and I've hit a wall on what could possibly be causing this. If you have any insight on what the issue could be, please help me out!

 

Thanks,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Collect Function Not Recognizing Specific Column of Table

Hi @dcoxi21 ,

Is ProjectID an unique field and be generated automatically?

If so, I suggest you use this field to compare not to update.

Try this:

ForAll(ResourceCost,
Patch('[dbo].[ResourceCost]', LookUp('[dbo].[ResourceCost]',ProjectID=projid),
{RoleID: LookUp('[dbo].[LINEITEM]', RoleID),
DailyCost: LookUp('[dbo].[LINEITEM]', DailyCost),
ResourceProfessionalFees: LookUp('[dbo].[LINEITEM]', ProFees),
ResourceID: LookUp('[dbo].[LINEITEM]', ResourceID),
ProfitSharing: LookUp('[dbo].[LINEITEM]', ProfitShared),
LeadBonus: LookUp('[dbo].[LINEITEM]', LeadBonus),
CreatedOn: Now(),
CreatedBy: "POWERAPPS_PRA",
LastModifiedOn: Now(),
LastModifiedBy: "POWERAPPS_PRA"
}
)
)

 

 

Best regards,

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.

View solution in original post

2 REPLIES 2
dynamicsedge Power Participant
Power Participant

Re: Collect Function Not Recognizing Specific Column of Table

@dcoxi21 

 

  1. Make sure ProjectID really is that column's name
  2. Try removing the data source, then re-adding data source - see if this helps.

 

 

Community Support
Community Support

Re: Collect Function Not Recognizing Specific Column of Table

Hi @dcoxi21 ,

Is ProjectID an unique field and be generated automatically?

If so, I suggest you use this field to compare not to update.

Try this:

ForAll(ResourceCost,
Patch('[dbo].[ResourceCost]', LookUp('[dbo].[ResourceCost]',ProjectID=projid),
{RoleID: LookUp('[dbo].[LINEITEM]', RoleID),
DailyCost: LookUp('[dbo].[LINEITEM]', DailyCost),
ResourceProfessionalFees: LookUp('[dbo].[LINEITEM]', ProFees),
ResourceID: LookUp('[dbo].[LINEITEM]', ResourceID),
ProfitSharing: LookUp('[dbo].[LINEITEM]', ProfitShared),
LeadBonus: LookUp('[dbo].[LINEITEM]', LeadBonus),
CreatedOn: Now(),
CreatedBy: "POWERAPPS_PRA",
LastModifiedOn: Now(),
LastModifiedBy: "POWERAPPS_PRA"
}
)
)

 

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,036)