Questions tagged [string.format]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
9k views

Escaping single quote character breaks String.format(stringToFormat, formattingArguments) [duplicate]

When I run this code: String.format('Dear {0}, Don\'t forget .... {1} .... {2}', args); Token 0 is replaced, but token 1 and 2 appear as {1} and {2} This is caused by the backslash escaping the ...
Robs's user avatar
  • 9,336
2 votes
3 answers
2k views

AMPScript/GTL function to check if variable is string or a numeric

Need to check a type of variable in ampscript, in order to use FormatNumber function(that can only work with integer variables). I tried the Handlebars function {{isString()}}, but can't make it ...
Mahmoud Gueye's user avatar
1 vote
1 answer
1k views

Is there a way to invoke Salesforce's phone number formatter on a given string?

I want to take all the phone numbers for a given contact in from a SOQL query (which provides the phone number in a raw format) and then have all of the phone numbers in this format as options in a ...
Robert Hyatt's user avatar
1 vote
1 answer
2k views

How to use String.format in JSON String

I have a JSON String as below. {"title":"ZoomMeetingfortesting","userId":"[email protected]","startTime":"2022-06-30T00:05:00.000Z","...
Nagendra Singh's user avatar
1 vote
1 answer
1k views

Issue with Export to Csv when name consists of comma

we are trying to export data into csv file using Apex and Visualforce page in Salesforce . The data is being exported but we have an issue . Here we are exporting record from an object(Text Fields) . ...
Tarun teja's user avatar
1 vote
1 answer
269 views

Parse JSON response

I create a record in one system and that creates the similar record in another and returns the corresponding ID from the destination system which I would to stamp in my source. Deserialized the ...
Priya's user avatar
  • 105
0 votes
1 answer
289 views

Passing dynamic query strings in the endpoint for the callout

We have been making an call out to an endpoint which till now was just accepting comma separated strings(two values) like /callme?ids='abc,xyz'.I implemented that as shown below and it worked fine: ...
Chetan's user avatar
  • 313
0 votes
1 answer
33 views

I want to break down a string REST response and only store some parts of it in a Salesforce Object

I'm receiving a Json response from a REST callout and populating a custom object with that information. One of the required fields is Secondary Locations, for this field I'm receiving a list of ...
David Boada's user avatar
0 votes
1 answer
239 views

Apex-List of string divide into lists of n size

I have a list of string something like below String roleId=105775004,105789004,105809004,105816004,105826004,105844004,105850004,105852004,105863004,105939004,105944004,105953004,105960004,105975004,...
starboy The's user avatar
0 votes
1 answer
661 views

Apex Error (Image to PDF conversion) : BLOB is not a valid UTF-8 string

So i have this task where i have to convert the image uploaded in Notes and Attachment object to PDF. For that i created a trigger(before insert) on Attachment object and used the below mentioned code,...
Muhammad Umer's user avatar