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

Re: MyTable[@fieldname] Field disambiguation

No. I don't think that works either. 

vsslasd
Level: Powered On

Re: MyTable[@fieldname] Field disambiguation

Thank you.

Trying the disambiguation [@Fieldname] gives me a "delegation warning" message.

 

I think your thought on the Rename columns is good.

 

 

PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: MyTable[@fieldname] Field disambiguation

 

If(Connection.Connected, 
    Set(vRecommendationRowId,
        ForAll(Filter(Recommendation,ActiveStatus="New" || ActiveStatus="Changed"),
            If(ActiveStatus="New",
                Patch('[dbo].[Recommendation]', Defaults('[dbo].[Recommendation]'),
                    {
                        Recommendation_ID: New_Recommendation_ID,
                        Service_Call_ID: Service_Call_ID,
                        LocationId: LocationId,
                        CustomerId: CustomerId,
                        EquipmentId: EquipmentId,
                        Description: Description,
                        DescriptionDetail: DescriptionDetail,
                        UserId: UserId,
                        Timestamp: Timestamp,
                        IsDeleted: IsDeleted,
                        RecordLongitude: RecordLongitude,
                        RecordLatitude: RecordLatitude,
                        PRM_Asset_Id: PRM_Asset_Id    
                    }
                ),
                Patch('[dbo].[Recommendation]', 
                    First(Filter('[dbo].[Recommendation]', Recommendation_ID = New_Recommendation_ID)),
                    {
                        Description: Description,
                        DescriptionDetail: DescriptionDetail,
                        Timestamp: Timestamp,
                        UserId: UserId,
                        IsDeleted: IsDeleted,
                        PRM_Asset_Id: PRM_Asset_Id
                    }
                )
            )
        )
    )
);

ForAll(
    Filter(RenameColumns(vRecommendationRowId,  "GID", "vRecommendationRowId_GID"), IsBlank(RowId)),
    Patch(Recommendation, First(Filter(Recommendation,vRecommendationRowId_GID=GID)),
        {RowId: RowId}
    )
);

 

Ah I see what's going on here.

  • It looks like you are expecting the actions in ForAll to result in a table set to the variable vRecommendationRowId. This is not going to work the way you expect since ForAll does not append rows to the variable. Instead, what you will want to do is collect a record to a collection each time something is patched (new or existing).
  • In the second ForAll statement, vRecommendationRowId needs to be a table. Once you fix it with the recommendations above, it should work as the first argument of ForAll
  • I am not exactly sure how your table is set up. I do not see the columns GID or RowId in your table. Can you clarify more?
  • You were missing a parenthesis in one part.
  • From an earlier post you mentioned you called the column GUID. I would refrain from naming things after existing names of functions in PowerApps. 

 

Can you clarify the question above and let me know how it goes with the changes I suggest?