You are on page 1of 1

@AuraEnabled(cacheable=true)

public static List<String> getMetaDataValues() {


List<String> metaDataValues = new List<String>();

List<ampi__Download_Budget_Planning_Template__mdt> queryResults = [SELECT Id,


label, ampi__Prepare_the_Excel_for_Upload__c,
ampi__Understanding_the_Downloaded_Excel__c FROM
ampi__Download_Budget_Planning_Template__mdt];

for (ampi__Download_Budget_Planning_Template__mdt mdt : queryResults) {


String commaSeparatedValues =
mdt.ampi__Understanding_the_Downloaded_Excel__c;
List<String> individualValues = commaSeparatedValues.split(',');

for (String value : individualValues) {


metaDataValues.add(value.trim()); // trim() method removes any leading
or trailing whitespace from each value
}
}

return metaDataValues;
}

//////////////////////////

public class budgetPlanningTemplateMetaData {


@AuraEnabled(cacheable=true)
public static void custMetaData(){
list<ampi__Download_Budget_Planning_Template__mdt> query = [SELECT
Id,label,ampi__Prepare_the_Excel_for_Upload__c,ampi__Understanding_the_Downloaded_E
xcel__c FROM ampi__Download_Budget_Planning_Template__mdt];
//system.debug('Query := '+
query.ampi__Understanding_the_Downloaded_Excel__c);
for(ampi__Download_Budget_Planning_Template__mdt mdt : query){
system.debug('for LoopQuery := '+
mdt.ampi__Understanding_the_Downloaded_Excel__c);
String commaSeparatedValues =
mdt.ampi__Understanding_the_Downloaded_Excel__c;
List<String> individualValues = commaSeparatedValues.split(',');

for (String value : individualValues) {


System.debug('List value :- '+ value.trim()); // trim() method
removes any leading or trailing whitespace from each value
}

}
}

//////////////////////////////////////////

for(integer i=0; i <= individualValues.length; i++){


system.debug('a ki val :'+ individualValues[i].trim());
}

You might also like