how can I find the id of a custom segment value by...
# ask-stanley-ai
b
how can I find the id of a custom segment value by its fullname (not just name)
c
AI generated answer (using internal Slack threads):
To find the ID of a custom segment value by its fullname, you can use SuiteScript. You would need to load the custom segment record and then iterate over the values until you find the one with the matching fullname. Here is a sample code snippet:
Copy code
javascript
var segment = record.load({
    type: 'customsegment', 
    id: 'your_custom_segment_id'
});

var numValues = segment.getLineCount({sublistId: 'values'});

for (var i = 0; i < numValues; i++) {
    var fullname = segment.getSublistValue({
        sublistId: 'values',
        fieldId: 'fullname',
        line: i
    });
    
    if (fullname === 'your_fullname') {
        var id = segment.getSublistValue({
            sublistId: 'values',
            fieldId: 'id',
            line: i
        });
        break;
    }
}
In this code, replace
'your_custom_segment_id'
with the ID of your custom segment and
'your_fullname'
with the fullname of the value you are looking for. The ID of the value will be stored in the
id
variable. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.79806596
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.770820558
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.770604908
Please provide your feedback on this answer.