I am looking for a way to retrieve numeric values from sales cloud object fields to perform math calculations in Marketing Cloud.
My code will first get the values for
RSVP__c from campaign object in sales cloud (which is working) and then using these 2 values to perform any simple math calculations.
Extra note: @key I used in RetrieveSalesforceObjects is obtained from my landing page url. (E.g My landing page URL is https://xxx?key=CampaignID)
%%[ var @totalaudiencecount, @rsvpcount, @key SET @key = QueryParameter("key") SET @totalaudiencecount= RetrieveSalesforceObjects('Campaign', 'Audience__c', 'Id', '=', @key) SET @rsvpcount= RetrieveSalesforceObjects('Campaign', 'RSVP__c', 'Id', '=', @key) ]%%
The above portion is retrieval of sales cloud object field records based on a campaignID, do let me know if my usage of @key is correct. Besides that, I am facing issues to perform calculations from the above numeric fields. Assuming I want to add both values together, how should I proceed from here? I am suspecting the error is due to both values being retrieved as string values. Is there a way to retrieve both values (
RSVP__c) in numeric type instead of string?