Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [expressions]

An expression in a programming language is a combination of one or more explicit values, constants, variables, operators, and functions that the programming language interprets (according to its particular rules of precedence and of association) and computes to produce ("to return", in a stateful environment) another value. This process, as for mathematical expressions, is called evaluation.

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

LWC optional chaining "array?.length' in expression causes output of "[object Object]"

Context: In my LWC, I have an array that may not be defined, and I want to check its length. So I use the optional chaining arr?.length to not error if the array is undefined. I also want to default ...
Andy Ray's user avatar
  • 1,468
1 vote
1 answer
1k views

How to modify a wired result in a getter?

I have a wired function in an LWC that populates an array (records) on success returning an address for each array value. @wire(searchSomething, { searchSomething: '$searchObject'}) wiredContacts(...
kratos's user avatar
  • 541
0 votes
1 answer
38 views

I'm trying to avoid or at least organize better expressions inside if statement in my code

Need help, my code has a lot of expressions in if statement and I'm trying to get rid of it or organize it in a better way. for example like this: if (fieldNumber==1 && (language=='en' || ...
Jen P's user avatar
  • 1
5 votes
4 answers
5k views

Conditional rendering based on key in for:each

I'm stuck on how to conditionally render (let alone apply styles) while in a for:each according to an expression. <lightning-layout-item padding="around-small"> <div class="header-column"...
Andrew's user avatar
  • 51
0 votes
1 answer
491 views

How to write Expressions in SOQL Query

I have a custom object Professor Professor { Name(Text) , Salary(Number) , Bonus(Number)} I wrote the query in Developer console select Name from Professor__c where (salary__c + bonus__c) > 7 ...
Dinesh Kumar's user avatar
0 votes
1 answer
496 views

Logical operators in Apex

How do I combine OR's and AND? The below gives me an error. Any pointers are helpful. Thanks // check changed values if ((old.value = '2' || old.value = '3') && (new.value = '0' || new....
Spiderman's user avatar
40 votes
5 answers
50k views

Expression Functions for Lightning Web Components

How can expression functions similar to Visualforce and Lightning Aura Components be achieved within lightning web components? For example, <template if:true={index % 5 == 0}><br></...
Oleh Berehovskyi's user avatar
0 votes
1 answer
62 views

I am trying to write an advanced expression which executes when a value in the field equals to Day of that month

I have this field named Billing Date it is a number field where you enter just only the day number and I want it to run every month on that date. So something like: IF(!(ISBLANK(BILLINGDATE)), ...
user avatar
3 votes
1 answer
5k views

Comparing two attributes in one expression

I am experiencing something strange, but I suspect I am doing something wrong I have two string aura:attributes. When I try to compare them, the comparison doesn't work. Here is an example Component ...
Sebastian Kessel's user avatar
0 votes
2 answers
74 views

verify schedule job expression

The scheduled job run everyday at 12 am. String schExp = '0 0 0 * * ?'; Is it correct?
Shilpa's user avatar
  • 687
1 vote
1 answer
235 views

What conditional syntax does aura/lightning support?

Does lightning only support conditional functions provided in this document? Or can I use javscript conditional format? Example: <aura:if isTrue="{!or(!v.displayTodayOnly, and(lessthanorequal(v....
TemporaryFix's user avatar
  • 2,946
1 vote
1 answer
296 views

Is it performance improvement to use unbound expression in array iteration?

Assuming elements in list may be added or removed but element properties stay the same, is it performance improvement to use {#...} instead {!...} ? In below example, it is decided that title prop is ...
wojciech.slodziak's user avatar
1 vote
1 answer
9k views

How to use Split() function inside an Expression in lightning component

I would like to use Split function inside my expression in salesforce lightning. I'm passing a map from my class and receiving the same in js controller and then converting it to List attribute for ...
AjaySFDC's user avatar
  • 618
7 votes
1 answer
6k views

Access Array attribute via Integer attribute in Lightning

I have a component... <aura:component> <aura:attribute name="myArray" type="Object" /> <aura:attribute name="index" type="Integer" default="0" /> ... {!v.myArray[v....
Robert Sösemann's user avatar
17 votes
4 answers
84k views

Getting the URL parameter into Lightning component using the "{! paramName}" expression

I am new to communities in lightning and I am trying to figure out a way to directly fetch the URL parameters into the lightning component attributes using the {! urlParamName} expressions. for ...
Tarique Shamim's user avatar
0 votes
1 answer
72 views

Expression Builder blockSubmit Form

I am developing a script to block submition of ASI Table variable of a date, but even when the blocking is in the condition and the condtion is not engaged it still gets executed. var totalRowCount = ...
Ruslan Batura's user avatar
6 votes
1 answer
11k views

Expression cannot be a statement Error

I want to create a batch job to compare a date and then update a related object. I want to have a short-hand ternary expression as I will have about 60 similar lines depending on the month. I have ...
Dan Wooding's user avatar
  • 3,578
7 votes
2 answers
176 views

simple expression evaluation for extended lightning component is sometimes wrong

In this simple and straightforward scenario the evaluation of an expression is not getting updated correctly. I have two components, an (abstract) base component and an extended one: cmBaseComponent:...
Christian Menzinger's user avatar
0 votes
1 answer
2k views

How to use Custom Labels inside of an expression on a custom button?

So I'll try to keep this short and simple. I have a client who wants to use Custom Labels in their buttons so the average user can duplicate and re-use them. One such label is simply the API name of ...
Monty Killough's user avatar
5 votes
2 answers
2k views

Lightning Components: expression inside <ltng:require /> fails

I have the following markup in a Component <aura:component controller="elfL1" implements="forceCommunity:availableForAllPageTypes,force:appHostable"> <aura:handler name="init" value="{!...
Uwe Heim's user avatar
  • 28.4k